#include <bits/stdc++.h>
using namespace std;

int A[100+10];
int B[100+10];
int main() {
    ios::sync_with_stdio(false);cin.tie(nullptr);
    int T; cin >> T;
    while(T--){
        int n; cin >> n;
        for (int i = 0; i < n; ++i) {
            cin >> A[i];
        }
        int l = 0, r = n-1;
        while (l<r){
            if(A[l]*A[r]>0){
                B[l] = A[r];
                B[r] = -A[l];
            }else{

                if(A[l]<0){
                    B[l] = A[r];
                    B[r] = -A[l];
                }else{
                    B[l] = -A[r];
                    B[r] = A[l];
                }
            }
            ++l, --r;
        }
        for (int i = 0; i < n; ++i) {
            if(i) cout << ' ';
            cout << B[i];
        }
        cout << "\n";
    }
    return 0;
}